<template>
    <el-card class="container">
        <div class="content">
            <div class="greet">您好，{{ username }}</div>
            <div class="up">
                <div class="wenzi">
                    <div class="left-align" v-if="roleId == 3">欢迎登录环保公众监督系统--公众监督员端。</div>
                    <div class="left-align" v-if="roleId == 2">欢迎登录环保公众监督系统--网格员端。</div>
                    <div class="left-align1">如果您的密码在其他网站也使用，建议您修改本网站密码。</div>
                    <router-link to="/UpdatePsw" class="gaimi" v-if="roleId == 3 || roleId == 2">修改密码</router-link>
                    <div class="left-align">如有任何疑问，请随时联系我们。</div>
                    <div class="left-align" v-if="roleId == 3">如果您需要反馈信息，请您点击</div>
                    <router-link to="/reportView" class="yuding" v-if="roleId == 3">提交反馈</router-link>
                </div>
            </div>
        </div>
        <div>
            <div class="else">
                <!-- 预留的其他内容区域 -->
            </div>
        </div>
    </el-card>
</template>

<script setup>
import { ref } from 'vue'
const username = ref('')

username.value = JSON.parse(sessionStorage.getItem('user')).username
const roleId = sessionStorage.getItem('roleId')
</script>

<style scoped>
.container {
    width: 99%;
    height: 95%;
    margin-top: 12px;
    border-radius: 12px;
    background: linear-gradient(to bottom right, #e0f7fa, #80deea); /* 渐变背景 */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../assets/img/1.jpg') no-repeat center center / cover; /* 背景图片路径 */
    opacity: 0.2;
    z-index: -1;
}


.greet {
    font-size: 2em;
    color: #333;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
}

.wenzi {
    font-size: 1em;
    color: #333;
    margin-bottom: 10px;
    width: 100%;
    background: rgba(255, 255, 255, 0.8);
    border: 2px dotted greenyellow;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.left-align {
    text-align: left;
    margin-top: 10px;
}

.left-align1 {
    text-align: left;
    margin-top: 10px;
    color: red;
}

.yuding, .gaimi {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    font-size: 1em;
    color: #fff;
    background: linear-gradient(45deg, #2196f3, #90caf9);
    border: none;
    border-radius: 5px;
    text-align: center;
    text-decoration: none;
}

.yuding {
    background: linear-gradient(45deg, #4caf50, #a5d6a7);
}

.gaimi {
    background: linear-gradient(45deg, #ff9800, #ffcc80);
}

.yuding:hover, .gaimi:hover {
    opacity: 0.9;
}

.else {
    margin-top: 50px;
}
</style>
